@extends('layouts.admin_panel')
@section('style')
	<link rel="stylesheet" type="text/css" href="/assets_admin_panel/global/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="/assets_admin_panel/global/plugins/bootstrap-datepicker/css/datepicker3.css"/>
@stop

@section('content')
    <!-- BEGIN PAGE HEADER-->
    <h3 class="page-title"> Sửa thông tin</h3>
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="index.html">Home</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">Người dùng</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">Sửa thông tin</a>
            </li>
        </ul>
    </div>
    <!-- END PAGE HEADER-->
    
    <div class="row">
        <div class="col-md-12">
            <div class="portlet box red-sunglo">
                <div class="portlet-title">
                    <div class="caption">
                        Sửa thông tin
                    </div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;" data-original-title="" title=""> </a>
                        <a class="config" data-toggle="modal" href="#portlet-config" data-original-title="" title=""> </a>
                        <a href="javascript:;" class="reload"></a>
                        <a href="javascript:;" class="remove"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    {{ Form::model($user, array(
                        'route' => array('admin.user.update', $user->id),
                        'id' => 'form-user-edit',
                        'class' => 'form-horizontal',
                        'method' => 'put',
                        'data-remote' => 'true',
                        'data-type' => 'json'
                    )) }}
                    
                    <div class="form-group"> 
                        <div class="col-sm-6">
                            <a href="{{ route('admin.user.index') }}" class="btn default"><i class=' icon-action-undo'></i> Quay lại</a>
                        </div>
                        <div class="col-sm-6">
                            {{ Form::button("<i class='icon-layers'></i> Lưu", array('type' => 'submit', 'class' => 'btn btn-success pull-right')) }}
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Quyền hạn</label>
                                <div class="col-md-9">
                                    {{ Form::select('role', CommonHelper::options( CommonHelper::nonSuperiorGroups() ),$user->group_id, array('class' => 'form-control user-group')) }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Họ tên</label>
                                <div class="col-md-9">
                                    {{ Form::text('full_name', null, array('class' => 'form-control' , 'placeholder' => 'e.g: Trần Văn An')) }}
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Email</label>
                                <div class="col-md-9">
                                    {{ Form::email('email', null, array('class' => 'form-control auto-focus', 'placeholder' => 'e.g: example@company.com')) }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Số điện thoại</label>
                                <div class="col-md-9">
                                    {{ Form::text('phone', null, array('class' => 'form-control' , 'placeholder' => 'e.g: 0999 999 999')) }}
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Địa chỉ</label>
                                <div class="col-md-9">
                                    {{ Form::textarea('address', null, array('class' => 'form-control', 'rows' => 2, 'placeholder' => 'e.g: 12th floor, Viet A tower, Duy Tan street, Hanoi, Vietnam')) }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                    	<div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Ngày sinh</label>
                                <div class="col-md-9">
                                    <div class="input-group date date-picker" data-date-start-date="-70y" data-date-format="dd-mm-yyyy">
                                    <input class="form-control" type="text" readonly="" name="dob">
                                        <span class="input-group-btn">
                                            <button class="btn default" type="button">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label col-md-3">Số điện thoại</label>
                                <div class="col-md-9">
                                    {{ Form::text('phone', null, array('class' => 'form-control' , 'placeholder' => 'e.g: 0999 999 999')) }}
                                </div>
                            </div>
                        </div>
                    </div>
                    {{ Form::close() }}  
                </div>
            </div>
        </div>
    </div>
@stop

@section('scripts')
	<script type="text/javascript" src="/assets_admin_panel/global/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/admin/layout/scripts/core.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/admin/layout/scripts/elements/user.js"></script>
@stop